﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UmSoft.SharePoint.Integration._1Cv77
{
    using System;
    using System.Collections.Generic;
    using UmSoft.SharePoint.Integration._1Cv77;

    public class V7DocumentMetadata : V7MetadataObject
    {
        public V7DocumentMetadata(V7Object v7Object)
            : base(v7Object)
        {
        }
        public V7MetadataObject GetHeaderRequisite(string requisiteName)
        {
            return new V7MetadataObject((base.InvokeMethod("РеквизитШапки",//89
                    new object[] {
                            requisiteName}) as V7Object));
        }
        public V7MetadataObject GetHeaderRequisite(int number)
        {
            return new V7MetadataObject(this.InvokeMethod("Записать", new object[] { number + 1 }) as V7Object);//59
        }
        public V7MetadataObject GetTablePartRequisite(string requisiteName)
        {
            return new V7MetadataObject((base.InvokeMethod("РеквизитТабличнойЧасти",//90
                    new object[] {
                            requisiteName}) as V7Object));
        }
        public V7MetadataObject GetTablePartRequisite(int number)
        {
            return new V7MetadataObject(this.InvokeMethod("РеквизитТабличнойЧасти", new object[] { number + 1 }) as V7Object);//90
        }
        public List<UmSoft.SharePoint.Integration._1Cv77.V7MetadataObject> HeaderRequisites
        {
            get
            {
                List<UmSoft.SharePoint.Integration._1Cv77.V7MetadataObject> list;
                int i1;
                int i = Convert.ToInt32(base.InvokeMethod("РеквизитШапки",//89
                        new object[0]));
                list = new List<UmSoft.SharePoint.Integration._1Cv77.V7MetadataObject>(i);
                i1 = 0;
                while (i1 < i)
                {
                    list.Add(GetHeaderRequisite(i1));
                    i1++;
                }
                return list;
            }
        }
        public List<UmSoft.SharePoint.Integration._1Cv77.V7MetadataObject> TablePartRequisites
        {
            get
            {
                int capacity = Convert.ToInt32(this.InvokeMethod("РеквизитТабличнойЧасти", new object[0]));//90
                List<V7MetadataObject> list = new List<V7MetadataObject>(capacity);
                for (int i = 0; i < capacity; i++)
                {
                    V7MetadataObject tablePartRequisite = this.GetTablePartRequisite(i);
                    list.Add(tablePartRequisite);
                }
                return list;
            }
        }
    }
}